<template>
	<view class="ucenter-page">
		<view class="bg"></view>
		<u-navbar title-size="36" back-icon-color="#15171A" :background="background"  height="42" :border-bottom="false"
			title="排行榜"></u-navbar>
		<view class="wrap">
			<view class="u-tabs-box">
				<u-tabs-swiper activeColor="#fff" inactive-color="rgba(255,255,255,0.3)" ref="tabs" :list="list"
					:current="current" @change="change" :is-scroll="false" swiperWidth="750" height="100" bar-width="48"
					bar-height="4" :bar-style="barStyle" :active-item-style="activeStyle"></u-tabs-swiper>
			</view>
			<swiper class="swiper-box" :current="swiperCurrent" @transition="transition"
				@animationfinish="animationfinish">
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
						<view class="scroll-content">
							<view class="rank-cell flex">
								<view class="rank-cell__item flex_bd rank-cell__second">
									<view class="pic">
										<image src="../../static/images/second.png" class="number" mode=""></image>
										<image src="../../static/images/rank2.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">张*力</view>
									<view class="money">30000元</view>
								</view>
								<view class="rank-cell__item flex_bd rank-cell__first">
									<view class="pic">
										<image src="../../static/images/first.png" class="number" mode=""></image>
										<image src="../../static/images/rank1.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">李*菁</view>
									<view class="money">50000元</view>
								</view>
								<view class="rank-cell__item flex_bd rank-cell__third">
									<view class="pic">
										<image src="../../static/images/third.png" class="number" mode=""></image>
										<image src="../../static/images/rank3.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">刘*</view>
									<view class="money">20000元</view>
								</view>
							</view>
							<view class="rank-panel">
								<view class="head">
									<view class="tips">排行榜每半年更新一次</view>
									<view class="rule flex-center" @click="openUrl('/pages/index/rankListRules')">
										<u-icon name="info-circle" size="32" color="rgba(255,255,255,0.3)"></u-icon>
										<text>排行榜规则说明</text>
									</view>
								</view>
								<view class="rank-body">
									<view class="rank-table rank-table-red">
										<view class="rank-tr flex-center">
											<view class="rank-number">
												4
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												¥18000
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												5
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												¥18000
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												6
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												¥18000
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												7
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												¥18000
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												8
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												¥18000
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												9
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												¥18000
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												10
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												¥18000
											</view>
										</view>
										<view class="rank-tr flex-center active">
											<view class="rank-number">
												48
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													我
												</view>
											</view>
											<view class="rank-money">
												¥16000
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
						<view class="scroll-content">
							<view class="rank-cell flex">
								<view class="rank-cell__item flex_bd rank-cell__second">
									<view class="pic">
										<image src="../../static/images/second.png" class="number" mode=""></image>
										<image src="../../static/images/rank2.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">张*力</view>
									<view class="money">83条</view>
								</view>
								<view class="rank-cell__item flex_bd rank-cell__first">
									<view class="pic">
										<image src="../../static/images/first.png" class="number" mode=""></image>
										<image src="../../static/images/rank1.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">李*菁</view>
									<view class="money">106条</view>
								</view>
								<view class="rank-cell__item flex_bd rank-cell__third">
									<view class="pic">
										<image src="../../static/images/third.png" class="number" mode=""></image>
										<image src="../../static/images/rank3.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">刘*</view>
									<view class="money">72条</view>
								</view>
							</view>
							<view class="rank-panel">
								<view class="head">
									<view class="tips">排行榜每半年更新一次</view>
									<view class="rule flex-center"  @click="openUrl('/pages/index/rankListRules')">
										<u-icon name="info-circle" size="32" color="rgba(255,255,255,0.3)"></u-icon>
										<text>排行榜规则说明</text>
									</view>
								</view>
								<view class="rank-body">
									<view class="rank-table">
										<view class="rank-tr flex-center">
											<view class="rank-number">
												4
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67条
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												5
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67条
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												6
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67条
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												7
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67条
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												8
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67条
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												9
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67条
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												10
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67条
											</view>
										</view>
										<view class="rank-tr flex-center active">
											<view class="rank-number">
												48
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													我
												</view>
											</view>
											<view class="rank-money">
												67条
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">
						<view class="scroll-content">
							<view class="rank-cell flex">
								<view class="rank-cell__item flex_bd rank-cell__second">
									<view class="pic">
										<image src="../../static/images/second.png" class="number" mode=""></image>
										<image src="../../static/images/rank2.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">张*力</view>
									<view class="money">83台</view>
								</view>
								<view class="rank-cell__item flex_bd rank-cell__first">
									<view class="pic">
										<image src="../../static/images/first.png" class="number" mode=""></image>
										<image src="../../static/images/rank1.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">李*菁</view>
									<view class="money">106台</view>
								</view>
								<view class="rank-cell__item flex_bd rank-cell__third">
									<view class="pic">
										<image src="../../static/images/third.png" class="number" mode=""></image>
										<image src="../../static/images/rank3.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">刘*</view>
									<view class="money">72台</view>
								</view>
							</view>
							<view class="rank-panel">
								<view class="head">
									<view class="tips">排行榜每半年更新一次</view>
									<view class="rule flex-center"  @click="openUrl('/pages/index/rankListRules')">
										<u-icon name="info-circle" size="32" color="rgba(255,255,255,0.3)"></u-icon>
										<text>排行榜规则说明</text>
									</view>
								</view>
								<view class="rank-body">
									<view class="rank-table">
										<view class="rank-tr flex-center">
											<view class="rank-number">
												4
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67台
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												5
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67台
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												6
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												68台
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												7
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												68台
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												8
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												68台
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												9
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												68台
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												10
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												68台
											</view>
										</view>
										<view class="rank-tr flex-center active">
											<view class="rank-number">
												48
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													我
												</view>
											</view>
											<view class="rank-money">
												56台
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">
						<view class="scroll-content">
							<view class="rank-cell flex">
								<view class="rank-cell__item flex_bd rank-cell__second">
									<view class="pic">
										<image src="../../static/images/second.png" class="number" mode=""></image>
										<image src="../../static/images/rank2.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">张*力</view>
									<view class="money">83位</view>
								</view>
								<view class="rank-cell__item flex_bd rank-cell__first">
									<view class="pic">
										<image src="../../static/images/first.png" class="number" mode=""></image>
										<image src="../../static/images/rank1.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">李*菁</view>
									<view class="money">106位</view>
								</view>
								<view class="rank-cell__item flex_bd rank-cell__third">
									<view class="pic">
										<image src="../../static/images/third.png" class="number" mode=""></image>
										<image src="../../static/images/rank3.jpg" class="avatar" mode=""></image>
									</view>
									<view class="name">刘*</view>
									<view class="money">72位</view>
								</view>
							</view>
							<view class="rank-panel">
								<view class="head">
									<view class="tips">排行榜每半年更新一次</view>
									<view class="rule flex-center"  @click="openUrl('/pages/index/rankListRules')">
										<u-icon name="info-circle" size="32" color="rgba(255,255,255,0.3)"></u-icon>
										<text>排行榜规则说明</text>
									</view>
								</view>
								<view class="rank-body">
									<view class="rank-table">
										<view class="rank-tr flex-center">
											<view class="rank-number">
												4
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67位
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												5
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												67位
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												6
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												68位
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												7
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												68位
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												8
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												68位
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												9
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												68位
											</view>
										</view>
										<view class="rank-tr flex-center">
											<view class="rank-number">
												10
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													林*超
												</view>
											</view>
											<view class="rank-money">
												68位
											</view>
										</view>
										<view class="rank-tr flex-center active">
											<view class="rank-number">
												48
											</view>
											<view class="rank-info flex_bd flex-center">
												<image src="../../static/images/rank4.jpg" mode="" class="avatar">
												</image>
												<view class="name">
													我
												</view>
											</view>
											<view class="rank-money">
												56位
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				background: {
					backgroundColor: '',
				},
				list: [{
						name: '佣金排行'
					},
					{
						name: '有效推荐'
					},
					{
						name: '成交排行'
					},
					{
						name: '邀请排行'
					}
				],
				current: 0,
				swiperCurrent: 0,
				tabsHeight: 0,
				dx: 0,
				barStyle: {
					bottom: '14rpx'
				},
				activeStyle: {
					fontWeight: 'normal'
				}
			}
		},
		onLoad() {

		},
		methods: {
			// tab栏切换
			change(index) {
				this.swiperCurrent = index;
			},
			transition({
				detail: {
					dx
				}
			}) {
				this.$refs.tabs.setDx(dx);
			},
			animationfinish({
				detail: {
					current
				}
			}) {
				this.$refs.tabs.setFinishCurrent(current);
				this.swiperCurrent = current;
				this.current = current;
			},
			openUrl(e) {
				console.log(e)
				uni.navigateTo({
					url: e
				});
			},
		}
	}
</script>

<style lang="scss">
	.ucenter-page {
		position: relative;
	}

	.bg {
		position: absolute;
		left: 0;
		width: 100%;
		top: 0;
		height: 820rpx;
		background: linear-gradient(180deg, #283C64 0%, #61708A 100%);
	}

	/deep/ .u-title {
		color: #15171A !important;
	}

	.scroll-content {}

	.wrap {
		display: flex;
		flex-direction: column;
		height: calc(100vh - 62px);
		width: 100%;
	}

	.swiper-box {
		flex: 1;
	}

	.swiper-item {
		height: 100%;
	}

	.rank-cell__item {
		height: 440rpx;
		text-align: center;

		.pic {
			width: 164rpx;
			height: 164rpx;
			border-radius: 100%;
			border: 6rpx solid rgba(255, 255, 255, 0.3);
			margin: 0 auto;
			position: relative;

			.avatar {
				width: 100%;
				height: 100%;
				display: block;
				border-radius: 100%;
			}

			.number {
				width: 72rpx;
				height: 70rpx;
				position: absolute;
				right: -8rpx;
				top: -40rpx;
			}
		}

		.name {
			font-size: 24rpx;
			color: #fff;
			opacity: 0.8;
			margin-top: 12rpx;
			margin-bottom: 4rpx;
		}

		.money {
			font-size: 28rpx;
			color: #fff;
			line-height: 40rpx;
		}
	}

	.rank-cell__second {
		padding-top: 120rpx;
	}

	.rank-cell__first {
		padding-top: 60rpx;
	}

	.rank-cell__third {
		padding-top: 148rpx;
	}

	.rank-panel {
		margin-top: -108rpx;

		.head {
			height: 306rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 32rpx;
			background: url(../../static/images/podium.png) no-repeat left bottom;
			background-size: 100% 100%;

			.tips {
				font-size: 24rpx;
				color: #fff;
				opacity: 0.3;
			}

			.rule {
				font-size: 24rpx;
				color: #fff;
				opacity: 0.3;

				.icon {
					width: 32rpx;
					height: 32rpx;
				}

				text {
					margin-left: 8rpx;
				}
			}
		}
	}

	.rank-table {
		margin-top: -110rpx;
		padding-top: 32rpx;
		background-color: #fff;
		border-radius: 20rpx 20rpx 0 0;
		.rank-tr {
			padding: 20rpx 0;
			border-radius: 20rpx 20rpx 0rpx 0rpx;
			.rank-number {
				color: #9C9C9C;
				font-size: 32rpx;
				text-align: center;
				width: 100rpx;
			}
			
			.rank-money{
				color: #A2C833;
				font-size: 32rpx;
				width: 150rpx;
			}
			
			.rank-info{
				.name{
					font-size: 32rpx;
					color: #383842;
				}
				
				.avatar{
					width: 80rpx;
					height: 80rpx;
					border-radius: 100%;
					display: block;
					margin-right: 24rpx;
				}
			}
		}
	
	    .rank-tr.active{
			background: #DCEFBA;
			
			.rank-number{
				color: #A2C833;
			}
		}
	}
	
	.rank-table.rank-table-red{
		.rank-tr{
			.rank-money{
				color: #FE6714;
			}
		}
		
		.rank-tr.active{
			background: #FFE4D5;
			
			.rank-number{
				color: #FE6714;
			}
		}
	}
</style>
